/****** Object:  StoredProcedure [dbo].[GetForumsVisibleToGroup]    Script Date: 11/03/2011 17:27:04 ******/
SET ANSI_NULLS OFF
GO

SET QUOTED_IDENTIFIER OFF
GO


CREATE PROCEDURE [GetForumsVisibleToGroup]
	@groupID int
AS 
SELECT
	f.forumid,
	title,
	tagline,
	threads,
	messages,
	indexorder,
	editflags,
	edittime
FROM forum_config f
	LEFT JOIN Forum_GroupAccess ga on f.forumid = ga.forumID
	LEFT JOIN Forum_Groups g on g.levelid = ga.groupid
WHERE
	g.levelid = @groupID
ORDER BY indexorder, forumid







GO


